package com.elai.overview.service.impl;

import java.util.List;
import com.elai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.elai.overview.mapper.MyOverviewBookMarkMapper;
import com.elai.overview.domain.MyOverviewBookMark;
import com.elai.overview.service.IMyOverviewBookMarkService;

/**
 * 我的书签Service业务层处理
 * 
 * @author elai
 * @date 2021-09-19
 */
@Service
public class MyOverviewBookMarkServiceImpl implements IMyOverviewBookMarkService 
{
    @Autowired
    private MyOverviewBookMarkMapper myOverviewBookMarkMapper;

    /**
     * 查询我的书签
     * 
     * @param id 我的书签ID
     * @return 我的书签
     */
    @Override
    public MyOverviewBookMark selectMyOverviewBookMarkById(Long id)
    {
        return myOverviewBookMarkMapper.selectMyOverviewBookMarkById(id);
    }

    /**
     * 查询我的书签列表
     * 
     * @param myOverviewBookMark 我的书签
     * @return 我的书签
     */
    @Override
    public List<MyOverviewBookMark> selectMyOverviewBookMarkList(MyOverviewBookMark myOverviewBookMark)
    {
        return myOverviewBookMarkMapper.selectMyOverviewBookMarkList(myOverviewBookMark);
    }

    /**
     * 新增我的书签
     * 
     * @param myOverviewBookMark 我的书签
     * @return 结果
     */
    @Override
    public int insertMyOverviewBookMark(MyOverviewBookMark myOverviewBookMark)
    {
        myOverviewBookMark.setCreateTime(DateUtils.getNowDate());
        return myOverviewBookMarkMapper.insertMyOverviewBookMark(myOverviewBookMark);
    }

    /**
     * 修改我的书签
     * 
     * @param myOverviewBookMark 我的书签
     * @return 结果
     */
    @Override
    public int updateMyOverviewBookMark(MyOverviewBookMark myOverviewBookMark)
    {
        return myOverviewBookMarkMapper.updateMyOverviewBookMark(myOverviewBookMark);
    }

    /**
     * 批量删除我的书签
     * 
     * @param ids 需要删除的我的书签ID
     * @return 结果
     */
    @Override
    public int deleteMyOverviewBookMarkByIds(Long[] ids)
    {
        return myOverviewBookMarkMapper.deleteMyOverviewBookMarkByIds(ids);
    }

    /**
     * 删除我的书签信息
     * 
     * @param id 我的书签ID
     * @return 结果
     */
    @Override
    public int deleteMyOverviewBookMarkById(Long id)
    {
        return myOverviewBookMarkMapper.deleteMyOverviewBookMarkById(id);
    }
}
